package com.johnny.xia.game;

public class DataCommand{

    private int data1;

    private int data2;

    private int data3;

    private int data4;

    private int data5;

    private int data6;

    private int data7;

    private int data8;

    private int data9;

    private int data10;

    private int data11;

    private int data12;

    private int data13;

    private int data14;

    private int data15;
    
    
    public boolean arrayToData(int[][] data){
        int n=1;
        for(int i=0;i<3;i++){
            for(int j=0;j<5;j++){
                n *= data[i][j];
                
                if(i==0){
                    setData(i*j+1, data[i][j]);
                }else if(i == 1){
                    setData(i*j+6, data[i][j]);
                }else{
                    setData(i*j+11, data[i][j]);
                }
            }
        }
        
        return n==0 ? false : true;
    }
    
    public void setData(int i,int data){
        switch(i){
            case 1:
                data1 = data; 
                break;
            case 2:
                data2 = data;
                break;
            case 3:
                data3 = data;
                break;
            case 4:
                data4 = data;
           break;
            case 5:
                data5 = data;
                break;
            case 6:
                data6 = data;
                break;
            case 7:
                data7 = data;
                break;
            case 8:
                data8 = data;
                break;
            case 9:
                data9 = data;
                break;
            case 10:
                data10 = data;
                break;
            case 11:
                data11 = data;
                break;
            case 12:
                data12 = data;
                break;
            case 13:
                data13 = data;
                break;
            case 14:
                data14 = data;
                break;
            case 15:
                data15 = data;
                break;
        }
    }

    public int getData1(){
        return data1;
    }

    public int getData2(){
        return data2;
    }

    public int getData3(){
        return data3;
    }

    public int getData4(){
        return data4;
    }

    public int getData5(){
        return data5;
    }

    public int getData6(){
        return data6;
    }

    public int getData7(){
        return data7;
    }

    public int getData8(){
        return data8;
    }

    public int getData9(){
        return data9;
    }

    public int getData10(){
        return data10;
    }

    public int getData11(){
        return data11;
    }

    public int getData12(){
        return data12;
    }

    public int getData13(){
        return data13;
    }

    public int getData14(){
        return data14;
    }

    public int getData15(){
        return data15;
    }

    public void setData1(int data1){
        this.data1 = data1;
    }

    public void setData2(int data2){
        this.data2 = data2;
    }

    public void setData3(int data3){
        this.data3 = data3;
    }

    public void setData4(int data4){
        this.data4 = data4;
    }

    public void setData5(int data5){
        this.data5 = data5;
    }

    public void setData6(int data6){
        this.data6 = data6;
    }

    public void setData7(int data7){
        this.data7 = data7;
    }

    public void setData8(int data8){
        this.data8 = data8;
    }

    public void setData9(int data9){
        this.data9 = data9;
    }

    public void setData10(int data10){
        this.data10 = data10;
    }

    public void setData11(int data11){
        this.data11 = data11;
    }

    public void setData12(int data12){
        this.data12 = data12;
    }

    public void setData13(int data13){
        this.data13 = data13;
    }

    public void setData14(int data14){
        this.data14 = data14;
    }

    public void setData15(int data15){
        this.data15 = data15;
    }

    @Override
    public int hashCode(){
        final int prime = 31;
        int result = 1;
        result = prime * result + data1;
        result = prime * result + data10;
        result = prime * result + data11;
        result = prime * result + data12;
        result = prime * result + data13;
        result = prime * result + data14;
        result = prime * result + data15;
        result = prime * result + data2;
        result = prime * result + data3;
        result = prime * result + data4;
        result = prime * result + data5;
        result = prime * result + data6;
        result = prime * result + data7;
        result = prime * result + data8;
        result = prime * result + data9;
        return result;
    }

    @Override
    public boolean equals(Object obj){
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        DataCommand other = (DataCommand) obj;
        if (data1 != other.data1)
            return false;
        if (data10 != other.data10)
            return false;
        if (data11 != other.data11)
            return false;
        if (data12 != other.data12)
            return false;
        if (data13 != other.data13)
            return false;
        if (data14 != other.data14)
            return false;
        if (data15 != other.data15)
            return false;
        if (data2 != other.data2)
            return false;
        if (data3 != other.data3)
            return false;
        if (data4 != other.data4)
            return false;
        if (data5 != other.data5)
            return false;
        if (data6 != other.data6)
            return false;
        if (data7 != other.data7)
            return false;
        if (data8 != other.data8)
            return false;
        if (data9 != other.data9)
            return false;
        return true;
    }

}
